/**
 * 
 */
Rsd.define('Rsd.form.TipButton', {
    extend: 'Rsd.control.Svg',
    requires: [],
    xtype: 'tip-button', 
    margin: "0 0 0 0",  
    width: "20px",
    label: false, 
    dataSource: {
        "viewBox":"0 0 1024 1024",
        "path":"M879.434463 254.819616C777.471211 109.006669 603.812055 42.457997 438.940031 69.437465c-64.207347 10.516518-127.116119 35.211966-183.90245 74.910107C52.443419 286.039665 2.904143 566.146201 144.565537 768.744455c10.206456 14.605649 30.293957 18.212804 44.922119 7.954159 14.573927-10.201339 18.145266-30.314423 7.940856-44.904723C76.137051 558.333258 118.543883 318.515311 292.01782 197.206454 465.371006 75.93239 705.245236 118.297266 826.570465 291.769157c121.29146 173.461657 78.884628 413.278581-94.589308 534.588461-118.299313 82.689281-271.081998 92.278683-398.883733 25.154913-15.754822-8.336876-35.240619-2.214435-43.545772 13.535271-8.272407 15.759939-2.211365 35.255968 13.566994 43.540655 149.250232 78.470189 327.740416 67.245544 465.843774-29.372981C971.556581 737.524406 1021.095857 457.417871 879.434463 254.819616zM593.769328 541.060873c40.602743-33.689287 60.641125-60.366879 73.006757-80.036871 12.366655-19.573801 18.59552-40.408315 18.59552-62.316278-0.096191-39.533388-10.490935-74.29817-44.281529-104.08866-33.785477-29.79663-72.807213-44.792159-129.87086-44.792159-54.334489 0-91.702562 14.800078-125.097136 44.301995-17.356296 15.33322-30.55797 32.400944-39.591717 51.175543-12.945847 26.907836 1.76111 52.896744 29.978778 61.177338l5.827729 1.108241c15.301498 2.276856 26.731828-4.693906 38.516222-26.332738 6.251378-11.479449 21.132296-25.41074 31.357172-34.057677 17.040095-14.411221 38.075177-21.61939 63.391772-21.61939 26.192545 0 46.931892 6.913457 62.417585 20.739347 15.380292 13.83203 23.172769 30.380938 23.172769 49.760311 0 13.922081-4.479011 26.677593-13.146415 38.264489-5.64865 7.303336-22.978341 22.786982-51.995211 46.351678-29.016871 23.562649-48.39522 44.887326-58.032718 63.681368-9.736758 18.889209-12.715603 30.993898-12.848633 60.304458-0.12689 27.885094 21.194718 35.607986 41.454134 35.607986 27.847232 0 39.647999-16.539698 42.843784-38.153972 1.169639-7.90504 2.89084-14.205537 5.15644-18.909675C559.689139 572.611449 572.641125 558.591131 593.769328 541.060873zM513.559519 674.65759 513.559519 674.65759c-27.479865 0-49.755194 22.276353-49.755194 49.756217 0 29.80891 20.715811 49.760311 49.755194 49.760311 27.478841 0 49.755194-22.276353 49.755194-49.755194l0-0.005117C563.315736 696.933943 541.039383 674.65759 513.559519 674.65759z"
    },
    tip: "点击查看信息",
    text:'',
    tipPosition:'right', 
    handler:'show_tip',
    /**
     * 
     * @param {*} config 
     */
    constructor: function TipButton (config) {
        config = config || {}; 
        this.apply(config);
        this.handler = 'show_tip';//防止被覆盖
    },
    /**
     * 
     * @param {*} sender 
     * @param {*} e 
     */
    show_tip: function show_tip(sender,e)
    {   
        var msg = sender.text||sender.tip;
        var height = 25 * (Math.floor(msg.length/30) + 2);
        switch(this.tipPosition)
        {
            case 'top':
                {
                    Rsd.showTip(msg,400,height,e.clientX-200,e.clientY-78,'bottom');
                    break; 
                }
            case 'bottom':
                {
                    Rsd.showTip(msg,400,height,e.clientX-200,e.clientY+28,'top');
                    break;
                }
            case 'left':
                {
                    Rsd.showTip(msg,400,height,e.clientX-410,e.clientY-28,'right');
                    break;
                }
            case 'right':
                {
                    Rsd.showTip(msg,400,height,e.clientX,e.clientY-28,'left');
                    break;
                }
            default:
                {
                    Rsd.showTip(msg,400,height,e.clientX,e.clientY-28,'left');
                    break;
                }   
        }
       
    }
});